<?php
/**
 * @package Core
 * @subpackage Data
 */ 

namespace Core\Data\SQL;

use \Core\Data\SQL\Adapters as Adapters;
use \Core\StringHandling as StringHandling;


class Connection implements Adapter {

    protected $Adapter;


    function __construct ( $strURL, $boolPersistent = false ) {

        $cstrURL = new StringHandling\URL ( $strURL );

        switch ( $cstrURL->Protocol ) {

            case "mysql":
                $this->Adapter = new Adapters\MySQL ( $strURL, $boolPersistent );

        }

    }

    public function escape ( $str ) {
        return $this->Adapter->escape( $str );
    }

    public function exec ( $mixQuery ) {
        $this->Adapter->exec( $mixQuery );
    }

    public function fetch ( $strQuery ) {
        return $this->Adapter->fetch( $strQuery );
    }

    public function getInsertKey () {
        return $this->Adapter->getInsertKey;
    }

    public function getNumQueriesSent () {
        return $this->Adapter->getNumQueriesSent();
    }

    public function query ( $strQuery ) {
        return $this->Adapter->query( $strQuery );
    }
  
}


?>